<template>
  <div>
    <cfg-pointer
      :mark="mark"
      v-model="editValue"
      :config="{type:'display'}"
      :label="label"
      :tip="tip"
      :disabled="disabled"
      :addField="addField"
      :clearable="true"
      :submitObj="submitObj"
      @clear="clear"
      @select="select"
    />
    <Modal
      v-model="drawer.show"
      :title="title || curTitle"
      v-bind="modalConfig"
      @on-ok="ok"
    >
      <div v-if="drawer.show" class="body-content">
        <model class="event-pointer-model"
            :type="''"
            :prefix="'event'"
            :searchData="editValue"
            :isPointer="true"
            @handleDbClick="handleDbClick"
            @handleSelect="handleSelect"
            @handleSelectCancel="handleSelectCancel"
        />
      </div>
    </Modal>
  </div>
</template>

<script>
import Model from "../../../../configuration/src/pages/eventManage/event/index.vue";
import pointerMixin from '../mixins/pointerMixin';

export default {
  name: "cfg-event-pointer",
  mixins: [pointerMixin],
  components: {Model},
  data() {
    return {
    }
  },
  props:{
    disabled: {
      return: false
    },
    title: {
      default:()=>{
        return '';
      }
    },
    // 选择数据后，需要回填的默认值，如 { linkModel: 'event' }
    defaultObj: {
      default() {
        return {
          linkModel: 'event'
        }
      }
    },
    // 选择模型后，需要返回的数据字段
    submitObj: {
      default() {
        return {
          category: 'category',
          name: 'name',
        }
      }
    },
  },
  mounted() {
  },
  computed: {
    curTitle() {
      return {"en-US": 'event model', "zh-CN": '事件'}[this.G_Locale]
    },
  }
}
</script>

<style lang="less" scoped>
  .event-pointer-model {
    overflow: hidden;
    /deep/ .cli-content-outline {
      height: auto;
    }
  }
</style>